/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __ALL_DONE_TEST_ALL_DONE_TEST__
#define __ALL_DONE_TEST_ALL_DONE_TEST__

#include "../tools/head.h"

namespace xos_box
{
    // 
    // buf interface
    // 
    class all_done_test : public xos_stl::mem_item< xos::release_impl< all_done_test >, thread_lock >,
        public i_all_done_test
    {
    public:
        typedef xos::release_impl< all_done_test > T;

    public:
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //
        static int get_xos_item_data( ITEM_DATA*& item_ptr );

    public:
        all_done_test();
        ~all_done_test();

    public:
        int set_notify( i_notify * pNotify, int nMsg );
        int add_num( int nNum );
        int test( int nNum );
        int reset();

    protected:
        i_notify * m_pNotify;
        bool m_bTest;
        int m_nSetNum;
        int m_nNum;
        int m_nMsg;

    protected:
        int init_data();

    public:
        int init();
        int term();

    public:
    };
}

#endif // __ALL_DONE_TEST_ALL_DONE_TEST__
